[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
replace(s)                   replace sub-expressions

    Return string  formed by  replacing all  repeated expressions, {n1,n2},
    and sub-expressions,  {name}, from  string s.  Same operation performed
    for strings used as regular expressions.

    For example, you desire to  replace several variables in the  following
    line with differing words depending upon the value of the variables:

    line = "{who} will use {quantity} of {item} supplied by: {supplier}."

    Assume that the variables have the following values:

    who = "Amalgamated";
    quantity = 135;
    item = "steamers";
    supplier = "Baysiders";

    Then:

    replace(line); ==>

    "Amalgamated will use 135 of steamers supplied by: Baysiders"

See Also: deletec insert
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson